import logging
log = logging.getLogger("templates")

import os, time
from mako.template import Template

pre_template_time = time.time()
root = os.path.dirname(__file__)

from mako.lookup import TemplateLookup

mylookup = TemplateLookup(directories=[os.path.join(root, 'tmpl'), os.path.join(root, 'tmpl', 'admin')])
index_template = Template(filename = os.path.join(root, 'tmpl/index.html'), lookup = mylookup)
info_template = Template(filename = os.path.join(root, 'tmpl/info.html'), lookup = mylookup)

torrent_detail_template = Template(filename = os.path.join(root, 'tmpl/torrent_detail.html'), lookup = mylookup)

post_template_time = time.time()

log.info("Template loaded in %s", pre_template_time - post_template_time)